<?php
require_once 'FL/Core.php';

abstract class FL_DBA extends FL_Core {
	
	abstract public function connect();
	abstract public function disconnect();
	abstract public function setDefaultScheme($scheme_name);
	abstract public function nextId();
	
	/**
	 * 
	 * executes SQL query
	 * @param string $sql
	 * @return FL_DBA_Result
	 */	
	abstract public function query($s_sql);
	abstract public function queryInsert($s_table_name, $a_values);
	abstract public function queryDelete($s_table_name, $s_pk_name, $i_pk_value);
	abstract public function queryUpdate($s_table_name, $s_pk_name, $i_pk_value, $a_values);
	abstract public function escape($string);
	abstract public function unescape($string);
	abstract public function isTableExists($s_table_name);
	
	abstract protected function _preprocess($sql);
	abstract protected function _getTFN($table_name, $schema_name = '');
}

abstract class FL_DBA_Result extends FL_Core {
	abstract public function fetchAllAsArray();	
	abstract public function fetchNextAsArray();
	abstract public function fetchAsValue($field, $row = 0);	
}